<?php

class Casecheck_model extends CI_Model {

    protected $hr = null;

    public function __construct() {
        parent::__construct();
        $this->hr = $this->load->database("hr", TRUE);
    }

    public function mt_casecheck($where = array(), $return = 0,$sql=null) { // หลักสูตรที่เปิด : object
        $this->db->select('ca_runno,ca_tname,ca_created');
        $this->db->from('mt_casecheck ');
        if (!empty($where)) {
            $this->db->where($where);
        }
        $qeury = $this->db->get();
   
        if(!empty($sql)){ 
           return  end($this->db->queries);

            }
        if ($qeury->num_rows()) {
            return ($return == 1) ? $qeury->result() : $qeury->row();
        } else {
            return array();
        }
    }
 

}

?>